import axios from '../axios';

export const accountPayApi = {
    //获取账户余额
    payInfo:() => {
        return axios.get('/pay/info')
        .then(response => response.data)
        .catch(error => {
            throw new Error(error);
        });
    },
    //获取收入
    payRecordIn:(data)=>{
         return axios.get('/pay/getPayRecordIn',{params:data})
        .then(response => response.data)
        .catch(error => {
            throw new Error(error);
        });
    },
    //获取支出
    payRecordOut:(data)=>{
        return axios.get('/pay/getPayRecordOut',{params:data})
        .then(response => response.data)
        .catch(error => {
            throw new Error(error);
        });
    },
    //充值
    insvertAccount:(money)=>{
         return axios.post('/pay/insvertMe?money='+money,{})
        .then(response => response)
        .catch(error => {
            throw new Error(error);
        });
    },
    //转账
    transferAccount:(data)=>{
        return axios.post('/pay/transfer',data)
        .then(response => response)
        .catch(error => {
            throw new Error(error);
        });
    }
}